<template>
  <div class="top">
    <div class="content">
      <div class="left">
        <img src="@/assets/title.svg" />
        <p>xx音乐在线</p>
      </div>
      <div class="center">
        <button @click="toIndex">首页</button>
        <button @click="toSong">原创音乐</button>
        <button @click="toRankInfo">排行榜</button>
        <button @click="toArtist">歌手</button>
        <button @click="toPlaylist">歌单</button>
        <button @click="toInformation">资讯</button>
        <button @click="toSearch">搜索</button>
      </div>
      <el-button color="#fb7299" style="margin-right: 200px;" @click="toUpload">上传稿件</el-button>
      <div class="right">
        <Header></Header>
        <login></login>
        <!-- <span v-if="isAuth">
          <user></user>
        </span>
        <span v-else="isAuth">
          <a href="/login"><p>登录/注册</p></a>
        </span> -->
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import user from "@/components/music-top/user.vue";
import { useUserStore } from "@/store/user.js";
import login from '@/components/music/components/Login.vue'
import Header from '@/components/music/components/Header.vue'


const router = useRouter();

const userStore = useUserStore();
const isAuth = userStore.getAuth();
const toUpload = () => {
  router.push({
    path: "/upload",
    // name: 'home',
  });
};
const toIndex = () => {
  router.push({
    path: "/music",
  });
};
const toSong = () => {
  router.push({
    path: "/original",
  });
};

const toRankInfo=()=>{
  router.push({
    path: "/rankInfo",
});
};
const toArtist=()=>{
  router.push({
    path: "/artist",
});
}
const toPlaylist=()=>{
  router.push({
    path: "/Playlist",
  });
}
const toInformation=()=>{
  router.push({
    path: "/information",
  });
}
const toSearch=()=>{
  router.push({
    path: "/search",
  });
}

</script>

<style lang="scss" scoped>
.top {
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: flex-start;
  .content {
    margin: auto;
    width: 100%;
    height: 40px;
    background: blue($color: #000000);
    display: flex;
    justify-content: space-between;
  }
  .left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    img {
      width: 60px;
      height: 40px;
    }
    p {
      margin-left: 5px;
      font-size: 20px;
      color: #00aeec;
    }
  }
  .center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 50px;
    button {
      width: 90px;
      height: 40px;
      margin-left: 50px;
      background-color: transparent;
      border-style: none;
      font-size: 15px;
      color: #00aeec;
      cursor: pointer;
    }
  }
  .right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-right: 50px;
    margin-left: 5px;
    font-size: 20px;
    color: #00aeec;
    cursor: pointer;
  }
}
</style>
